//get settings
document.onreadystatechange = function()
{
	if (document.readyState == "complete")
	{
		var userID = System.Gadget.Settings.read("userid");

		if (userID != "")
		{
			userIDbox.value = userID;
		}
	}	
}


//save settings
System.Gadget.onSettingsClosing = function(event) 
{
	if (event.closeAction == event.Action.commit)
	{
		var userID = userIDbox.value;
		if (userID != "")
		{
			System.Gadget.Settings.write("userid", userID);
		}
		event.cancel = false;
	}
}
